<?php
/**
* Admin for System Apps
*
* @author Mario Schillermann <info@rockit-flash.com>
* @encoding UTF-8 äöüßÖÄÜ
* @copyright © 2011 Mario Schillermann (info@rockit-flash.com)
* @license GNU GPL v2 (http://www.gnu.org/licenses/old-licenses/gpl-2.0.html)
* @package Page
* @subpackage Index
* @link $HeadURL$
* @version SVN: $Id$
* @phpVersion >=5
* @todo
*/

class Rockitbos_DashboardController extends Zend_Controller_Action
{
    /**
     * Initialize the general options
     *
     * @return void
     */
    public function init()
    {
        $this->_helper->layout->disableLayout();
        //$this->_helper->viewRenderer->setNoRender(true);
    }
    /**
     * Dashboard for apps
     *
     * @return void
     */
    public function indexAction()
    {
/*
        $auth = Zend_Auth::getInstance();
        $identity = $auth->getIdentity();

        $baseUrl = $this->view->baseUrl(
            "application" . DIRECTORY_SEPARATOR .
            "modules" . DIRECTORY_SEPARATOR .
            "admin" . DIRECTORY_SEPARATOR .
            "public" . DIRECTORY_SEPARATOR .
            "desktop");



        $this->_helper->layout->setLayout('desktop');
        $this->view->baseUrlCss = $this->view->baseUrl("application/modules/admin/public/desktop/css/");
        $this->view->baseUrlImages = $this->view->baseUrl("application/modules/admin/public/desktop/images/");
        $this->view->app = $this->getRequest()->path;
        $this->view->username = $identity['username'];*/
        //$this->view->applist = Rockitbos_Model_Applist::get();
        /*
        $front = Zend_Controller_Front::getInstance();
        // Modulenames and -paths
        $modules = $front->getControllerDirectory();
        $apps = array();
        foreach ($modules as $module => $path) {
            //Checks if the config file exists
            $appIni = realpath($path . DIRECTORY_SEPARATOR . ".." . DIRECTORY_SEPARATOR . "configs" . DIRECTORY_SEPARATOR . "app.ini");
            if ($appIni != false) {
                // App data are stored into a new array
                $apps[$module]['path'] = $path;
                // Load header data
                $appData = new Zend_Config_Ini($appIni, 'app');
                // Merging all datas in new array
                $apps[$module] = array_merge($apps[$module], $appData->toArray());
            }
        }
        */
        $cssPath = $this->view->baseUrl('application/modules/rockitbos/public/css');
        $this->view
             ->headLink()
             ->appendStylesheet(
                 $cssPath . DIRECTORY_SEPARATOR .
                 "dashboard.css"
               );

        $front = Zend_Controller_Front::getInstance();
        $this->view->apps = Rockitbos_Model_App::getApps();
        $this->view->favorites = Rockitbos_Model_App::getFavorites();
        $this->view->cssUrl = $this->view->baseUrl('application/modules/rockitbos/public/css/');

    }
}